<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>
<body>
    <script>
        // 背景图片加文字爬取
        let items = document.getElementsByClassName('top')[0].children;
        let arr = [];
        for (let i = 0; i < items.length; i++) {
            let obj = {};
            let item = items[i];
            obj.url = item.getElementsByClassName('img')[0].style.backgroundImage.slice(5,-2);
            obj.title = item.getElementsByClassName('name')[0].innerText;
            arr.push(obj);
        }
        // console.log(arr);
        let listdata = JSON.stringify(arr)
        console.log(listdata);
        console.log(头部数据);
        
        // 分类加背景图片加文字爬取
        let items = document.getElementsByClassName('list-wrapper')[0].children;
        let arr = [];
        for (let i = 0; i < items.length; i++) {
            let obj = {};
            let item = items[i];
            obj.name = item.getElementsByClassName('name')[0].innerText;
            obj.data = [];
            let items2 = item.getElementsByClassName('list')[0].children;
            // let arr2 = [];
        for (let i = 0; i < items2.length; i++) {
            let obj2 = {};
            let item2 = items2[i];
           obj2.url = item2.getElementsByClassName('img')[0].src;
            obj2.title = item2.getElementsByClassName('name')[0].innerText;    
            obj.data.push(obj2);
        }
            arr.push(obj);
        }
        // console.log(arr);
        let listdata = JSON.stringify(arr)
        console.log(listdata);
        console.log(中间数据);
        
// 背景图片爬取
        let items = document.getElementsByClassName('brand-group-list')[0].children;
        let arr = [];
        for (let i = 0; i < items.length; i++) {
           
            let item = items[i];
         
            arr.push(item.style.backgroundImage.slice(5,-2));
        }
        // console.log(arr);
        let listdata = JSON.stringify(arr)
        console.log(listdata);
        console.log(品牌数据);
        

    </script>

</body>
</html>